package com.itheima.d7_thread_pool;

import com.itheima.d1_create_thread.MyRunnable;

import java.util.concurrent.*;

public class ThreadPoolTest1 {
    public static void main(String[] args) {
        ThreadPoolExecutor pool = new ThreadPoolExecutor(3, 5, 8,
                TimeUnit.SECONDS, new ArrayBlockingQueue<>(4), Executors.defaultThreadFactory(),
                new ThreadPoolExecutor.AbortPolicy());

        Runnable target =new MyRunnable();
        for (int i = 0; i < 9; i++) {
            pool.execute(target);
        }

        pool.shutdown();
        //pool.shutdownNow();

    }
}
